package com.huluobo.a2202mvvm_im_douyindemo.addFriend;

import androidx.lifecycle.MutableLiveData;

import com.huluobo.a2202mvvm_im_douyindemo.mvvmBase.BaseRepo;
import com.hyphenate.EMCallBack;

/**
 * Created by LC on 2024/4/24.
 */
public class AddFriendRepo extends BaseRepo {
    public void addFriend(String username, String reason, MutableLiveData<String> success,
                          MutableLiveData<String> failed) {
        emClient.contactManager().aysncAddContact(username, reason, new EMCallBack() {
            @Override
            public void onSuccess() {
                success.postValue("添加好友成功");
            }

            @Override
            public void onError(int code, String error) {
                failed.postValue(error);
            }
        });
    }
}
